<template>
	<div class="EntryFromEdit">
		<div class="form-title">
			<i class="el-icon-document"></i>
			<h4 class="form-title-text">修改</h4>
		</div>
		<div class="form-context">
			<el-form ref="form" :model="form.enroll" label-width="110px">
        <el-row style="width:900px;">
          <el-col :span="6">
            <el-form-item label="货主">
                <el-input v-model="form.enroll.owner" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="料号">
                <el-input v-model="form.enroll.code" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
             <el-form-item label="描述">
               <el-input v-model="form.enroll.ms" style="width:100%;"></el-input>
             </el-form-item>
          </el-col>
          <el-col :span="6">
             <el-form-item label="库区">
               <el-input v-model="form.enroll.kq" style="width:100%;"></el-input>
             </el-form-item>
          </el-col>
        </el-row>
        <el-row style="width:900px;">
          <el-col :span="6">
            <el-form-item label="存储属性">
                <el-input v-model="form.enroll.saveAttribute" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="库位">
                <el-input v-model="form.enroll.kw" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="LPN">
                <el-input v-model="form.enroll.lpn" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
           <el-col :span="6">
             <el-form-item label="是否ECCN">
                <el-select v-model="form.enroll.iseccn" placeholder="-请选择-">
                   <el-option label="是" value="是"></el-option>
                   <el-option label="否" value="否"></el-option>
                </el-select>
             </el-form-item>
           </el-col>
        </el-row>

        <el-row style="width:900px;">
          <el-col :span="6">
            <el-form-item label="是否叉板">
              <el-select v-model="form.enroll.iscb" placeholder="-请选择-">
                <el-option label="是" value="是"></el-option>
                <el-option label="否" value="否"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="09码">
                <el-input v-model="form.enroll.ljCode" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
             <el-form-item label="制造日期">
                <el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-dd" v-model="form.enroll.madeTime" style="width:100%">
                </el-date-picker>
              </el-form-item>
          </el-col>
           <el-col :span="6">
              <el-form-item label="DC">
                <el-input v-model="form.enroll.dc" style="width:100%;"></el-input>
               </el-form-item>
           </el-col>
        </el-row>

        <el-row style="width:900px;">
          <el-col :span="6">
            <el-form-item label="收货日期">
              <el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-dd" v-model="form.enroll.reciveTime" style="width:100%">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="供应商全称">
                <el-input v-model="form.enroll.supilerName" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
             <el-form-item label="供应商代码">
                <el-input v-model="form.enroll.suppilerCode" style="width:100%;"></el-input>
              </el-form-item>
          </el-col>
           <el-col :span="6">
              <el-form-item label="LPN现有量">
                 <el-input v-model="form.enroll.lpnxyl" style="width:100%;"></el-input>
               </el-form-item>
           </el-col>
        </el-row>
        <el-row style="width:900px;">
          <el-col :span="6">
            <el-form-item label="LPN可用量">
                <el-input v-model="form.enroll.lpnkyl" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="LPN已分配量">
                <el-input v-model="form.enroll.lpnyfpl" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
             <el-form-item label="LPN已拣货量">
               <el-input v-model="form.enroll.lpnyjhl" style="width:100%;"></el-input>
              </el-form-item>
          </el-col>
           <el-col :span="6">
              <el-form-item label="状态">
                 <el-input v-model="form.enroll.zt" style="width:100%;"></el-input>
               </el-form-item>
           </el-col>
        </el-row>

        <el-row style="width:900px;">
          <el-col :span="6">
            <el-form-item label="注释">
                <el-input v-model="form.enroll.commnet" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="LPN是否拆分">
                <el-input v-model="form.enroll.lpniscf" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
             <el-form-item label="物料型号">
                <el-input v-model="form.enroll.wlxh" style="width:100%;"></el-input>
              </el-form-item>
          </el-col>
           <el-col :span="6">
              <el-form-item label="erp子库">
                  <el-input v-model="form.enroll.erpzk" style="width:100%;"></el-input>
               </el-form-item>
           </el-col>
        </el-row>

        <el-row style="width:900px;">
          <el-col :span="6">
            <el-form-item label="到期日期">
               <el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-dd" v-model="form.enroll.endTime" style="width:100%">
               </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="批次">
                <el-input v-model="form.enroll.batch" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
             <el-form-item label="库龄">
                <el-input v-model="form.enroll.kl" style="width:100%;"></el-input>
              </el-form-item>
          </el-col>
          <el-col :span="6">
             <el-form-item label="货龄">
               <el-input v-model="form.enroll.hl" style="width:100%;"></el-input>
             </el-form-item>
          </el-col>
        </el-row>

        <el-row style="width:900px;">
          <el-col :span="6">
            <el-form-item label="落放id">
                <el-input v-model="form.enroll.lfId" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="po">
                <el-input v-model="form.enroll.po" style="width:100%;"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
             <el-form-item label="箱号">
                <el-input v-model="form.enroll.xh" style="width:100%;"></el-input>
              </el-form-item>
          </el-col>
           <el-col :span="6">
              <el-form-item label="物料版本">
                <el-input v-model="form.enroll.wlbb" style="width:100%;"></el-input>
               </el-form-item>
           </el-col>
        </el-row>
        <el-row style="width:900px;">
           <el-col :span="6">
             <el-form-item label="模穴号">
                 <el-input v-model="form.enroll.mxh" style="width:100%;"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="6">
             <el-form-item label="外箱特殊标签">
                 <el-input v-model="form.enroll.wxtsbq" style="width:100%;"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="6">
              <el-form-item label="锁定状态">
                <el-input v-model="form.enroll.lockzt" style="width:100%;"></el-input>
               </el-form-item>
           </el-col>
            <el-col :span="6">
               <el-form-item label="用户ID">
                   <el-input v-model="form.enroll.employeeId" style="width:100%;"></el-input>
                </el-form-item>
            </el-col>
         </el-row>

        <el-row style="width:900px;">
          <el-col :span="6">
            <el-form-item label="合同号">
              <el-input v-model="form.enroll.hth" style="width:100%;"></el-input>
            </el-form-item>
           </el-col>
           <el-col :span="6">
             <el-form-item label="LPN动态分布量">
                 <el-input v-model="form.enroll.lpndtfbl" style="width:100%;"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="6">
             <el-form-item label="潮敏等级">
                 <el-input v-model="form.enroll.cmdj" style="width:100%;"></el-input>
             </el-form-item>
           </el-col>
           <!--<el-col :span="6">
              <el-form-item label="潮敏等级">
                 <el-select v-model="form.region" placeholder="请选择活动区域">
                    <el-option label="区域一" value="shanghai"></el-option>
                    <el-option label="区域二" value="beijing"></el-option>
                 </el-select>
               </el-form-item>
           </el-col>
            <el-col :span="6">
               <el-form-item label="活动区域">
                  <el-select v-model="form.region" placeholder="请选择活动区域">
                     <el-option label="区域一" value="shanghai"></el-option>
                     <el-option label="区域二" value="beijing"></el-option>
                  </el-select>
                </el-form-item>
            </el-col>-->
         </el-row>



			<!--	<el-form-item    prop="activityName"
                         :rules="[{ required: true, message: '活动名不能为空' }]"
					label="活动名称">
					<el-input type="activityName" v-model="form.openDayActivityType.activityName"
						style="width:100%;"></el-input>
				</el-form-item>
				<el-form-item label="活动日期"
        >
					<el-date-picker
						v-model="form.openDayActivityType.timeAnge"
						type="daterange"
						align="right"
						value-format="yyyy-MM-dd"
						unlink-panels
						range-separator="至"
						start-placeholder="开始日期"
						end-placeholder="结束日期"
						>
					</el-date-picker>
				</el-form-item>
				<el-form-item
          label="活动报名截止时间">
					<el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-dd"
                          v-model="form.openDayActivityType.entryTime" style="width:100%"></el-date-picker>
				</el-form-item>
				<el-form-item label="备注">
					<el-input type="textarea" v-model="form.openDayActivityType.memo" :rows=10></el-input>
				</el-form-item>-->
				<el-form-item>
					<el-button type="primary" @click="onSubmit">保存</el-button>
					<el-button @click="onCancel">取消</el-button>
				</el-form-item>
			</el-form>
		</div>
	</div>
</template>

<script>
import Qs from 'qs'
export default {
	name: 'OpenDayFormAdd',

	 components:{

	 },
	created(){
		this.$store.commit("update",[{name:'日常工作',router:'/'},{name:'原材料隔离跟踪',router:'/OpenDayFormAdd'}]);
	},
	methods:{
		onCancel(){
			this.$router.push('EntrySchoolForm');
		},
		onSubmit() {
		  var _this=this;
			this.$refs['form'].validate((valid)=>{
				if(valid){
           var param=Qs.stringify({stock:JSON.stringify(this.form.enroll)});
           var url='/stock/update';
           this.$axios.post(url,param,{headers:{'Content-Type':'application/x-www-form-urlencoded'}}).then(res=>{
             console.log(res.data);
             if(res.data){
             		this.$notify({
             			title: '成功',
             			message: '修改成功',
             			type: 'success'
                });
                this.$router.push('EntrySchoolForm');
             }
            });
				}else{
					this.$message('表单数据有误，请检查后提交');
				}
			});
		}
	},
	computed:{
	      form:{
              get(){
                  return this.$store.state.enroll;
              },
              set(){

              }
        }
	}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

.EntryFromEdit{
	width:100%;
	heigth:100%;
	background-color:#fff;
	border-radius: 2px;
	border:1px solid #E1E6EB;
}

.form-title{
	width:100%;
	height:50px;
	background:#F5F6FA;
	display: flex;
	justify-content: flex-start;
	align-items: center;
}
.el-icon-document{
	color:#2196F3;
	margin-left:24px;
	font-size:12px;
}
.form-title-text{
	font-family: "Adobe 宋体 Std L";
	margin-left: 17px;
}
.form-context{
	margin:36px 50px;
	width:480px;
}

</style>
